package org.example.chapter3.config;

import org.example.chapter3.pojo.DatabaseProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import pojo.Squirrel;

import java.util.logging.Logger;

/**
 * @author xshuai
 */
@EnableConfigurationProperties({DatabaseProperties.class})
public class IoCTest {
    private static final Logger log = Logger.getLogger("IoCTest.class");

    public static void main(String[] args) {
        AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(AppConfig.class);
        Squirrel squirrel = (Squirrel) ctx.getBean("squirrel");
        squirrel.use();
    }
}
